const fs = require("node:fs")
const path = require("node:path")

fs.writeFile(path.join(__dirname,"test","hello.txt"),"I Love JS\n",{},err => {
    if (err) throw err
    console.log("File writting to...")

    // 追加文件内容
    fs.appendFile(path.join(__dirname,"test","hello.txt"),"I Love Node",{},err => {
        if (err) throw err
        console.log("File writting to...")
    })
})